package 类和对象;

class Fish {
	int weight;
}

class Lake {
	Fish fish;

	void setFish(Fish s) {
		fish = s;
	}

	void eat(int n) {
		fish.weight = fish.weight + n;
	}
}

class FishandLake {
	public static void main(String[] args) {
		Fish niqiu = new Fish();
		System.out.println(niqiu.weight);
		Lake taihu = new Lake();
		taihu.setFish(niqiu);
		taihu.eat(15);
		Lake beijiaerhu = new Lake();
		beijiaerhu.setFish(niqiu);

		Lake xihu = new Lake();
		xihu.setFish(niqiu);

		System.out.println(niqiu.weight);
		System.out.println(taihu.fish.weight);
		System.out.println(beijiaerhu.fish.weight);
		System.out.println(xihu.fish.weight);

	}

}
